<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改管理權限規則</title>
</head>

<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/> <%//連結資料庫的bean %>
   <table width="750" border="0" align="center">
  <tr>
    <td width="30" rowspan="4"><jsp:include page="../frameset/left.jsp" flush="true" ></jsp:include></td>
    <td colspan="2"><jsp:include page="../frameset/top.jsp" flush="true" ></jsp:include></td>
    <td width="40" rowspan="4"><jsp:include page="../frameset/right.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td rowspan="2"><jsp:include page="../frameset/mean.jsp" flush="true" ></jsp:include>

    </td>
    <td height="32"><jsp:include page="../frameset/level_mean.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td>
    <table width="500" cellspacing="0" cellpadding="0"> 
 <tr>
    <td align="center" valign="top" bordercolor="1">
    
   <%
      String sql="select * from SYS_SETTING WHERE S_NAME='delay_day_deadline'";
	  ResultSet rs_day=mydb.executeQuery(sql);
	  rs_day.next();
      String delay_day = rs_day.getString(3); //取出逾期天數底限
      
      sql="select * from SYS_SETTING WHERE S_NAME='delay_item_deadline'";
	  ResultSet rs_item=mydb.executeQuery(sql);
	  rs_item.next();
      String delay_item = rs_item.getString(3); //取出逾期項目數量底限
      
      sql="select * from SYS_SETTING WHERE S_NAME='damage_freq'";
	  ResultSet rs_dam=mydb.executeQuery(sql);
	  rs_dam.next();
      String dam_freq = rs_dam.getString(3); //取出破壞場地設備次數底限
      
    %>
      <div align="center">  
        <table width="100%"  border="0" cellspacing="1" cellpadding="1">
          <tr>
            <td align="center" valign="top" bordercolor="#00CCFF"><div align="center">修改權限規則
            <form name="myForm" method="post" action="do_alterLevelrule.jsp">    <%//送出表單 %>
              <table width="100%"  border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#999999">
                 
                <tr>
                  <td><div align="right">逾期天數超過</div></td>
                  <td><div align="left"><span class="lggytext11">
                    <select name="delay_day">
    <option value="1" <% if(delay_day.equalsIgnoreCase("1")) out.print("selected");%>>1</option>
    <option value="2" <% if(delay_day.equalsIgnoreCase("2")) out.print("selected");%>>2</option>
    <option value="3" <% if(delay_day.equalsIgnoreCase("3")) out.print("selected");%>>3</option>
    <option value="4" <% if(delay_day.equalsIgnoreCase("4")) out.print("selected");%>>4</option>
    <option value="5" <% if(delay_day.equalsIgnoreCase("5")) out.print("selected");%>>5</option>
    <option value="6" <% if(delay_day.equalsIgnoreCase("6")) out.print("selected");%>>6</option>
    <option value="7" <% if(delay_day.equalsIgnoreCase("7")) out.print("selected");%>>7</option>
    <option value="8" <% if(delay_day.equalsIgnoreCase("8")) out.print("selected");%>>8</option>
    <option value="9" <% if(delay_day.equalsIgnoreCase("9")) out.print("selected");%>>9</option>
    <option value="10" <% if(delay_day.equalsIgnoreCase("10")) out.print("selected");%>>10</option>
    </select>
                  </span>天以上</div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td><div align="right">逾期項目超過</div></td>
                  <td><div align="left"><span class="lggytext11">
                    <select name="delay_item">
    <option value="1" <% if(delay_item.equalsIgnoreCase("1")) out.print("selected");%>>1</option>
    <option value="2" <% if(delay_item.equalsIgnoreCase("2")) out.print("selected");%>>2</option>
    <option value="3" <% if(delay_item.equalsIgnoreCase("3")) out.print("selected");%>>3</option>
    <option value="4" <% if(delay_item.equalsIgnoreCase("4")) out.print("selected");%>>4</option>
    <option value="5" <% if(delay_item.equalsIgnoreCase("5")) out.print("selected");%>>5</option>
    <option value="6" <% if(delay_item.equalsIgnoreCase("6")) out.print("selected");%>>6</option>
    <option value="7" <% if(delay_item.equalsIgnoreCase("7")) out.print("selected");%>>7</option>
    <option value="8" <% if(delay_item.equalsIgnoreCase("8")) out.print("selected");%>>8</option>
    <option value="9" <% if(delay_item.equalsIgnoreCase("9")) out.print("selected");%>>9</option>
    <option value="10" <% if(delay_item.equalsIgnoreCase("10")) out.print("selected");%>>10</option>
    </select>
                  </span>項以上</div></td>
                </tr>
            <tr>
                  <td><div align="right">破壞場地設備超過</div></td>
                  <td><div align="left"><span class="lggytext11">
                    <select name="dam_freq">
    <option value="1" <% if(dam_freq.equalsIgnoreCase("1")) out.print("selected");%>>1</option>
    <option value="2" <% if(dam_freq.equalsIgnoreCase("2")) out.print("selected");%>>2</option>
    <option value="3" <% if(dam_freq.equalsIgnoreCase("3")) out.print("selected");%>>3</option>
    <option value="4" <% if(dam_freq.equalsIgnoreCase("4")) out.print("selected");%>>4</option>
    <option value="5" <% if(dam_freq.equalsIgnoreCase("5")) out.print("selected");%>>5</option>
    <option value="6" <% if(dam_freq.equalsIgnoreCase("6")) out.print("selected");%>>6</option>
    <option value="7" <% if(dam_freq.equalsIgnoreCase("7")) out.print("selected");%>>7</option>
    <option value="8" <% if(dam_freq.equalsIgnoreCase("8")) out.print("selected");%>>8</option>
    <option value="9" <% if(dam_freq.equalsIgnoreCase("9")) out.print("selected");%>>9</option>
    <option value="10" <% if(dam_freq.equalsIgnoreCase("10")) out.print("selected");%>>10</option>
    </select>
                  </span>次以上</div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                  <td colspan="2"><div align="right">
                      <input type="hidden"  name="textfield"/>
                      <input name="Submit" type="submit"  value="修改"> 
                  </div></td>
                </tr>
              </table>
            
               
<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
 <%--內頁--%>
</body>
</html>
